import 'package:dala_flutter/dala/http/dio_instance.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import './dala/pages/tabs.dart';
import "./dala/routers/routers.dart";

Future<void> main() async {
  // 初始化 Dio
  DioInstance.instance().initDio(baseUrl: "http://192.168.31.110:8080/");
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false, // 去除右上角debug标签条
      title: '搭拉客户端',
      builder: BotToastInit(), //1.调用BotToastInit
      navigatorObservers: [BotToastNavigatorObserver()], //2.注册路由观察者
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        // 去除按钮点击水波纹 全局设置
        splashColor: Colors.transparent, // 点击时的高亮效果设置为透明
        highlightColor: Colors.transparent, // 长按时的扩散效果设置为透明
        useMaterial3: true,
      ),
      home: const Tabs(),
      initialRoute: "/",
      onGenerateRoute: onGenerateRoute,
    );
  }
}
